import argparse

parser = argparse.ArgumentParser()
parser.add_argument("filename", help="Name of file to parse (..._all.data)")
args = parser.parse_args()

ins = open( args.filename , "r" )

display = False

for line in ins:
	line = line.split()

	if display == True:
		if "---" in line:
			print ""
			display = False
		else:
			print ' '.join(line)
	else:
		if "(fitness" in line and "0.0)" not in line[len(line)-1] and "-1.7976931348623157E308)" not in line[len(line)-1] and "-1.0" not in line[len(line)-1]:
			print "#",
			print ' '.join(line)
			display = True

ins.close()
